package luogu.editor;

import java.util.Arrays;
import java.util.Scanner;

public class P9241 {
    
}
class Main {
    static int t,n;
    static boolean[] bk = new boolean[15];
    static Plane[] a = new Plane[15];
    static class Plane {
        int t, d, l;

        Plane(int t, int d, int l) {
            this.t = t;
            this.d = d;
            this.l = l;
        }
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        t = sc.nextInt();
        while (t-- > 0) {
            n = sc.nextInt();
            for (int i = 1; i <= n; i++) {
                a[i] = new Plane(sc.nextInt(), sc.nextInt(), sc.nextInt());
            }
            Arrays.fill(bk, false); // 清空标记数组
            if (dfs(1, 0)) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
        sc.close();
    }
    static boolean dfs(int dep, int tim) {
        if (dep > n) {
            return true;
        }
        for (int i = 1; i <= n; i++) {
            if (bk[i] || a[i].t + a[i].d < tim) { // 跳过已经降落或不符合条件的飞机
                continue;
            }
            bk[i] = true;
            if (dfs(dep + 1, Math.max(tim, a[i].t) + a[i].l)) { // 记得取 max
                bk[i] = false;
                return true; // 有一个成功就返回 true
            }
            bk[i] = false; // 去标记
        }
        return false;
    }
}